﻿using System.Collections.Generic;
using HarrisDesigns.Controls.dasBlogControls.Twitter;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace dasBlogControls.Test.Twitter
{
    [TestClass]
    public class WhenTwitterDataHasBeenDownloaded
    {
        private List<Status> _context;
        public List<Status> Context
        {
            get
            {
                if (_context == null)
                {
                    _context = (new Repository(){UserIdentity = "jayharris", MaxItems = 10, PollingInterval = 10}).GetCurrentData();
                }
                return _context;
            }
        }

        [TestMethod]
        public void ItShouldContainOnlyStatusesFromTheUser()
        {
            foreach (var status in Context)
            {
                Assert.AreEqual("jayharris", status.User.ScreenName);
            }
        }
        [TestMethod]
        public void ItShouldContain10Statuses()
        {
            Assert.AreEqual(10, Context.Count);
        }
    }
}